{% extends "OspUserBundle::layout.html.twig" %}

{% block OspUser_body %}
	<h3>Modification de l'utilisateur {{user.prenom ~ " " ~ user.nom ~ " (" ~ user.id ~ ")"}}</h3>

	<div class="well form-inline">
		<form method="post" {{ form_enctype(form) }}>
			
			<legend>Modifier un utilisateur</legend>
			<table class="table table-striped">
				<thead>
					<tr>
						<th>Login</th>
						<th>Rôle</th>
						<th>Nom</th>
						<th>Prénom</th>
						<th>Mot de passe</th>
					</tr>
				</thead>
				
				<tbody>
					<tr>
						<td>{{ form_widget(form.username, { value : user.username,'attr': {'class': 'input-small'} }) }}</td>
						<td>{{ form_widget(form.roles, { value : user.getRolesString(),'attr': {'class': 'input-small'} }) }}</td>
						<td>{{ form_widget(form.nom, { value : user.nom,'attr': {'class': 'input-small'} }) }}</td>
						<td>{{ form_widget(form.prenom, { value : user.prenom,'attr': {'class': 'input-small'} }) }}</td>
						<td>{{ form_widget(form.password, { 'attr': {'class': 'input-small'} }) }}</td>
					</tr>	
				</tbody>

				<thead>
					<tr>
						<th>Adresse</th>
						<th>Code Postal</th>
						<th>Ville</th>
						<th>Email</th>
						<th>Téléphone</th>
					</tr>
				</thead>

				<tbody>
					<tr>
						<td>{{ form_widget(form.adresse, { value : user.adresse,'attr': {'class': 'input-small'} }) }}</td>
						<td>{{ form_widget(form.codePostal, { value : user.codePostal,'attr': {'class': 'input-small'} }) }}</td>
						<td>{{ form_widget(form.ville, { value : user.ville,'attr': {'class': 'input-small'} }) }}</td>
						<td>{{ form_widget(form.email, { value : user.email,'attr': {'class': 'input-small'} }) }}</td>
						<td>{{ form_widget(form.telephone, { value : user.telephone,'attr': {'class': 'input-small'} }) }}</td>
					</tr>	
				</tbody>
			</table>
			<input type="submit" class="btn btn-primary" value="Modifier Utilisateur" style="margin-left:65%" />
			<a href="{{ path('osp_user_homepage') }}" class="btn btn-primary">Annuler<a/>
			{{ form_rest(form) }}
		</form>
	</div>

{% endblock %}